#!/bin/bash
BASE_PATH=$(cd `dirname $0`; pwd)
cd $BASE_PATH
source /root/.bashrc

REPORTS_PATH=$BASE_PATH/../reports

mkdir -p $REPORTS_PATH/pdepend $REPORTS_PATH/coverage

phploc --quiet --count-tests --log-csv $REPORTS_PATH/phploc-1.csv app tests
phpmd app xml codesize,unusedcode,naming --reportfile $REPORTS_PATH/pmd-1.xml --minimumpriority 2
phpcs -s app --ignore=app/Models --report=checkstyle --report-file=$REPORTS_PATH/checkstyle-1.xml --standard=PSR2
pdepend --jdepend-xml=$REPORTS_PATH/pdepend/pdepend.xml --jdepend-chart=$REPORTS_PATH/pdepend/dependencies.svg --overview-pyramid=$REPORTS_PATH/pdepend/overview-pyramid.svg app
phpcpd --log-pmd $REPORTS_PATH/phpcpd.xml app
phpunit --testdox --colors=never --coverage-clover $REPORTS_PATH/coverage/coverage.xml --coverage-html $REPORTS_PATH/coverage --log-junit $REPORTS_PATH/unitreports-1.xml
